Computer emulation involves emulating a target computing system with a different computer system. There are various reasons for emulating a computer system, including testing, or debugging, the program code associated with the computer system. Another reason is that when a computer center is updated with different computing systems, the problem of program compatibility becomes acute.
Computer systems that have become obsolete may include program code which is not compatible with other computing systems which might be used to replace the obsolete system. When computers become obsolete, or are replaced for any reason, the users want to run their old programs on the new machine without having to rewrite them. These programs can be moved to the new machine provided that the new machine can simulate the execution of each individual instruction as well as the registers and hardware features of the old machine. This can be accomplished by providing the new programming level with an interpreter for executing programs in the old machine language. The interpreter for the old machine is typically referred to as an emulator.
There are various types of emulation available, including interpretive emulation and compiled emulation. The interpretive execution approaches uses an interpreter to decode each target computer instruction and call a routine to emulate each of the operations that would have been performed by the target system. This approach is effective, but slow. Emulating hardware functions is time consuming because hardware can perform many functions in parallel, while software must perform the same functions serially.
The compiled execution approach is faster than the interpretive approach. For compiled execution, a compiler analyzes object code instructions and converts them into native mode routines which perform the same function.
However, these emulation techniques still do not handle all situations, and still operate at less than desirable speeds. Emulation of object code by execution of pre-compiled instructions is not practical when there is a mixture of instructions and data within a memory bank, as the compiler is unable to differentiate between them. It is also not practical where instruction modification is allowed. Instruction modification (also referred to as self-modifying code) refers to the modification of the program as the program is executed. Although this technique is generally disfavored today, system still exist with such self-modifying code, and the compiled execution approach does not handle such a situation well.
It is therefore desirable to provide very fast emulation of the target computing system, and to manage situations such as instruction/data mixtures and self-modifying code. The present invention provides a new approach called "transformed execution", that utilizes transformed instruction and data banks which in turn allows certain emulation steps to be bypassed, thereby increasing emulation efficiency and performance. The present invention provides numerous advantages over the prior art, including selectable execution performance based on transformation time and storage space tradeoffs, wherein high performance transformations can be directed at high usage banks or instructions, and slower (more space saving) transformations can be directed to lower usage banks or instructions. Instruction modification is allowed, and the original instructions are never destroyed or modified by the transformation. The transformed banks are portable, and allow for a mixture of instructions and data. Improvements in transformation techniques can be included without user intervention, by implementing additional emulation code and selecting a new level of transformation.
The present invention provides a solution to the aforementioned problems, and offers other advantages over the prior art.